export namespace tsclass1 {

    class Person {
        name: string;
        age: number;

        constructor(name: string, age: number) {
            this.name = name;
            this.age = age;
        }
        greet() {
            console.log(`Hello, my name is ${this.name} and I am ${this.age} years old.`)
        }
    }
    const person = new Person('Alice', 30)
    person.greet();

    abstract class Animal {
        constructor(public name: string) {
        }
        abstract move(distance: number): void;

    }
    class Snake extends Animal {

        constructor(name: string) {
            super('cnm')
        }
        move(distance: number): void {
            console.log(`移动了${distance}米`)
        }
    }

    const snake = new Snake('cnm')
    snake.move(5000)

}